Optimal. Leaf size=33 \[ -\frac {a \cos ^3(c+d x)}{3 d}+\frac {b \sin ^2(c+d x)}{2 d} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.04, antiderivative size = 33, normalized size of antiderivative = 1.00, number of steps
used = 6, number of rules used = 5, integrand size = 26, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.192, Rules used = {4462, 12, 2644,
30, 2645} \begin {gather*} \frac {b \sin ^2(c+d x)}{2 d}-\frac {a \cos ^3(c+d x)}{3 d} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 12
Rule 30
Rule 2644
Rule 2645
Rule 4462
Rubi steps
\begin {align*} \int \cos ^2(c+d x) (a \sin (c+d x)+b \tan (c+d x)) \, dx &=a \int \cos ^2(c+d x) \sin (c+d x) \, dx+\int b \cos (c+d x) \sin (c+d x) \, dx\\ &=b \int \cos (c+d x) \sin (c+d x) \, dx-\frac {a \text {Subst}\left (\int x^2 \, dx,x,\cos (c+d x)\right )}{d}\\ &=-\frac {a \cos ^3(c+d x)}{3 d}+\frac {b \text {Subst}(\int x \, dx,x,\sin (c+d x))}{d}\\ &=-\frac {a \cos ^3(c+d x)}{3 d}+\frac {b \sin ^2(c+d x)}{2 d}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A]
time = 0.14, size = 38, normalized size = 1.15 \begin {gather*} -\frac {3 a \cos (c+d x)+3 b \cos (2 (c+d x))+a \cos (3 (c+d x))}{12 d} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A]
time = 0.10, size = 29, normalized size = 0.88
method | result | size |
derivativedivides | \(-\frac {\frac {a \left (\cos ^{3}\left (d x +c \right )\right )}{3}+\frac {\left (\cos ^{2}\left (d x +c \right )\right ) b}{2}}{d}\) | \(29\) |
default | \(-\frac {\frac {a \left (\cos ^{3}\left (d x +c \right )\right )}{3}+\frac {\left (\cos ^{2}\left (d x +c \right )\right ) b}{2}}{d}\) | \(29\) |
risch | \(-\frac {a \cos \left (d x +c \right )}{4 d}-\frac {a \cos \left (3 d x +3 c \right )}{12 d}-\frac {b \cos \left (2 d x +2 c \right )}{4 d}\) | \(44\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [A]
time = 0.25, size = 28, normalized size = 0.85 \begin {gather*} -\frac {2 \, a \cos \left (d x + c\right )^{3} - 3 \, b \sin \left (d x + c\right )^{2}}{6 \, d} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A]
time = 3.59, size = 28, normalized size = 0.85 \begin {gather*} -\frac {2 \, a \cos \left (d x + c\right )^{3} + 3 \, b \cos \left (d x + c\right )^{2}}{6 \, d} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \int \left (a \sin {\left (c + d x \right )} + b \tan {\left (c + d x \right )}\right ) \cos ^{2}{\left (c + d x \right )}\, dx \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [B] Leaf count of result is larger than twice the leaf count of optimal. 99 vs.
\(2 (29) = 58\).
time = 0.48, size = 99, normalized size = 3.00 \begin {gather*} -\frac {a \cos \left (3 \, d x + 3 \, c\right )}{12 \, d} - \frac {a \cos \left (d x + c\right )}{4 \, d} - \frac {b \tan \left (d x\right )^{2} \tan \left (c\right )^{2} - b \tan \left (d x\right )^{2} - 4 \, b \tan \left (d x\right ) \tan \left (c\right ) - b \tan \left (c\right )^{2} + b}{4 \, {\left (d \tan \left (d x\right )^{2} \tan \left (c\right )^{2} + d \tan \left (d x\right )^{2} + d \tan \left (c\right )^{2} + d\right )}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [B]
time = 0.64, size = 49, normalized size = 1.48 \begin {gather*} -\frac {\left (\cos \left (c+d\,x\right )+1\right )\,\left (2\,a-3\,b-2\,a\,\cos \left (c+d\,x\right )+3\,b\,\cos \left (c+d\,x\right )+2\,a\,{\cos \left (c+d\,x\right )}^2\right )}{6\,d} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________